import time
from selenium import webdriver


driver = webdriver.Chrome()
driver.get("http://192.168.0.108/index.php")
time.sleep(2)
driver.find_element_by_xpath("//*[text() = '登录']").click()
time.sleep(2)
# back() 后退 --> 模拟浏览器后退按钮
driver.back()
time.sleep(2)
# forward() 前进 --> 模拟浏览器前进按钮
driver.forward()
time.sleep(2)
# refresh() 刷新 --> 模拟浏览器F5刷新
driver.refresh()
time.sleep(2)
driver.find_element_by_id("username").send_keys("13125056588")
time.sleep(2)
driver.find_element_by_link_text("中国互联网举报中心").click()
time.sleep(2)
# close() 关闭当前窗口 --> 模拟点击浏览器关闭按钮
driver.close()
time.sleep(2)
# quit() 关闭浏览器驱动对象 --> 关闭所有程序启动的窗口
driver.quit()
time.sleep(2)

